package com.ht.base.system.biz.manager;

import com.ht.base.system.common.pojo.bo.SysDeptBO;
import com.ht.base.system.common.pojo.qto.SysDeptQTO;
import com.ht.base.system.common.pojo.vo.TreeSelect;
import org.base.common.appexception.AppException;
import org.base.common.page.PageBO;

import java.util.List;

public interface SysDeptManager {
    Boolean saveDept(SysDeptBO dept) throws AppException;

    Boolean updateDept(SysDeptBO dept) throws AppException;

    Boolean delDept(Long sysDeptId) throws AppException;

    SysDeptBO findDeptById(Long sysDeptId) throws AppException;

    PageBO<SysDeptBO> findDeptForPage(SysDeptQTO qto) throws AppException;

    /**
     * 查询组织列表
     * @param qto
     * @return
     * @throws AppException
     */
    List<SysDeptBO> findSysDeptList(SysDeptQTO qto) throws AppException;

    /**
     * 构建组织树
     * 参数是非树结构
     * @param deptList
     * @return
     * @throws AppException
     */
    List<SysDeptBO> buildDeptTree(List<SysDeptBO> deptList) throws AppException;

    /**
     * 构建前端树
     * 传入的是树结构的部门集合
     * @param deptTree
     * @return
     * @throws AppException
     */
    List<TreeSelect> buildTreeSelect(List<SysDeptBO> deptTree) throws AppException;
}
